using System.Collections.Generic;
using System.Linq;
using System.Xml.Linq;

namespace OrbitOne.CRMLyncInfoDashboard.CRM.OData
{
    public class EntityData
    {
        public EntityData(IEntityModel[] entityModels, 
            EntitytMetadataModel entitytMetadataModel)
        {
            Data = entityModels;
            EntitytMetadataModel = entitytMetadataModel;
            SequenceNumber = !Data.Any()
                                 ? 0
                                 : Data.First().SequenceNumber;
        }

        public IEntityModel[] Data { get; private set; }
        public EntitytMetadataModel EntitytMetadataModel { get; private set; }
        
        public IList<SavedQueryColumnInfo> SavedQueryColumnInfos { get; set; }

        public int SequenceNumber
        {
            get; private set; 
        }
    }
}